Repository navigation
docs: add PrivateStaticAssetsConstruct to the 3.0 migration guide - #118
Conversation
Refs #112 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review — focus: accuracy of the StaticSiteConstruct vs PrivateStaticAssetsConstruct comparison against the source of both constructs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e9e4e3c57
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| | Website endpoint | Yes | No | | ||
| | DNS and certificate | Required (Route53 lookup and ACM) | Optional; the CloudFront domain is used by default | | ||
| | SPA rewrites | Always on | Off by default | | ||
| | Deployment | Prunes, auto-deletes objects, bucket destroyed with the stack | Versioned prefix, no prune, objects and bucket retained by default | |
There was a problem hiding this comment.
Distinguish bucket versioning from a versioned deployment prefix
With the default props, PrivateStaticAssetsConstruct does not deploy under a versioned prefix: DestinationKeyPrefix defaults to null and is passed directly to BucketDeployment, so assets are written at the bucket root and subsequent deployments overwrite the same keys. The bucket enables S3 object versioning, but that does not provide versioned asset URLs. Describe the versioned bucket and optional caller-supplied prefix separately so consumers do not assume immutable deployment paths are supplied automatically.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid. Fixed in c56b061: the guide now separates S3 object versioning from immutable paths. Deployments go to the bucket root unless DestinationKeyPrefix is set, so pass a per-release prefix (for example game/<commit-sha>/). The comparison table row was corrected to match.
| Moving an existing site from `StaticSiteConstruct` to the new construct creates a new bucket and | ||
| distribution (new CloudFront domain). Plan the DNS cutover and content copy; it is not an in-place | ||
| update. See [Private Static Assets](../constructs/private-static-assets.md). |
There was a problem hiding this comment.
Qualify the claim that migration replaces the distribution
When a consumer switches construct classes while retaining the same parent scope and construct ID, both implementations create the distribution with the same ${id}-cdn child ID and resource type. Its CloudFormation logical ID therefore remains unchanged, allowing the origin and distribution settings to update in place rather than necessarily creating a new distribution or CloudFront domain. Distinguish this migration from deploying a separate construct under a new ID; the unconditional replacement claim gives consumers an inaccurate DNS cutover plan.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid. Both constructs use the {id}-cdn and {id}-bucket child IDs. Fixed in c56b061: with the same construct ID, the distribution keeps its logical ID and updates in place, so the CloudFront domain is kept. The bucket is still replaced, because StaticSiteConstruct sets BucketName (a replacement-only property), and the DNS alias records (different child IDs) are recreated. A new construct ID creates everything anew. The guide now asks for a content copy and a cdk diff review in both cases.
- Distinguish S3 object versioning from a caller-supplied immutable DestinationKeyPrefix (default is the bucket root). Codex P2. - Qualify the StaticSiteConstruct migration: with the same construct ID the distribution keeps its logical ID and updates in place; the bucket is still replaced (named bucket) and DNS records are recreated. Codex P2. - Note that 2.x is not compatible with Amazon.CDK.Lib 2.278.0 (MissingMethodException AddWarningV2), observed in #112 Sharedale validation; upgrade both packages together. Refs #112 (cdkc-2lh.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review — focus: commit c56b061 only (docs/migration/v3.md). Check that the PrivateStaticAssetsConstruct versioning and StaticSiteConstruct migration wording now matches |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c56b0612f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| The minimum AWS CDK version is now 2.278.0. Upgrade the two packages together: 2.x releases of this | ||
| library do not run against `Amazon.CDK.Lib` 2.278.0. For example, 2.6.0's `WebFunctionConstruct` | ||
| fails at synthesis with `MissingMethodException` (`Amazon.CDK.Annotations.AddWarningV2`). |
There was a problem hiding this comment.
Scope the CDK incompatibility warning to the validated usage
For consumers using other constructs or earlier 2.x releases, this states a package-wide incompatibility that the cited failure does not establish. In the pre-3.0 source (43f3ad8), AddWarningV2 is referenced only by WebFunctionConstruct and WebFunctionEndpointConstruct, not by constructs such as DynamoDbTableConstruct; a missing method in those Web Function paths does not prevent unrelated constructs from running. Describe the observed 2.6.0 Web Function failure and recommend upgrading both packages together without asserting that every 2.x release and usage fails, particularly since §1 directs .NET 8/9 consumers to remain on 2.x.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid. I had generalized one observed failure. At 43f3ad8, AddWarningV2 is referenced only by WebFunctionConstruct and WebFunctionEndpointConstruct. Fixed in the latest commit: the note now describes the observed 2.6.0 WebFunctionConstruct failure, recommends upgrading both packages together, and tells 2.x consumers (for example on .NET 8/9) who use the Web Function constructs to keep Amazon.CDK.Lib below 2.278.0. 2.6.0 was built against 2.274.0 and validated downstream with 2.275.0.
The observed failure (2.6.0 WebFunctionConstruct, MissingMethodException AddWarningV2 against Amazon.CDK.Lib 2.278.0) does not establish that every 2.x release or construct fails. State the observed case, recommend upgrading both packages together, and tell 2.x consumers using the Web Function constructs to stay below CDK 2.278.0. Codex P2. Refs #112 (cdkc-2lh.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review — focus: the latest commit only (docs/migration/v3.md §2 CDK pairing note). Check that it is now scoped to the observed Web Function failure and is consistent with §1. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Refs #112 (migration guide). Beads:
cdkc-2lh.5.Adds section 6 to
docs/migration/v3.md: the newPrivateStaticAssetsConstruct(from #116), a comparison withStaticSiteConstruct(bucket access, website endpoint, DNS/certificate, SPA rewrites, deployment and retention), and a note that moving an existing site is a new bucket and distribution, not an in-place update. The former section 6 (consumer test projects) becomes section 7.Documentation only (TDD exemption: no behavior). Validation:
git diff --checkclean; the relative link../constructs/private-static-assets.mdresolves. No local MkDocs build (not installed; the Docs workflow builds onmain).🤖 Generated with Claude Code